<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:sijyp="http://java.sun.com/jsf/composite/sijyp"
	template="#{bienManager.vincularHechoMode ? '/templates/simpleTemplate.xhtml' : '/templates/template.xhtml'}">
	<ui:define name="body">
		<rich:panel style="width:100%">
		
			<f:facet name="header">
				#{msg['configuracion.parametrizacion']}
			</f:facet>

			<h:form id="frm_datos">
				<h:panelGroup layout="block">
					<f:event type="javax.faces.event.PreRenderComponentEvent"
						listener="#{detalleParametroConfig.initView}" />		
					
					#{msg['configuracion.parametrizacion.titulo_datos_parametro']}
					<hr width="100%" />
					<br />
						
					<h:panelGrid width="100%">
						<h:panelGrid>
							<h:outputLabel
								value="#{msg['configuracion.parametrizacion.nombreparametro']}*:" />
							<h:inputText id="parametro"
								value="#{detalleParametroConfig.paramConfgDto.parametro}"
								required="true"
								disabled="#{detalleParametroConfig.estado == 'VER'}"
								requiredMessage="#{msgVal['constraint.not_null']}">
								<f:validateLength maximum="50" />
							</h:inputText>
							<h:message for="parametro" showSummary="true"
								showDetail="false" styleClass="validationErrorMessage" />
						</h:panelGrid>
					</h:panelGrid>

					<h:panelGrid width="100%">
						<h:outputLabel value="#{msg['configuracion.parametrizacion.parametrodescripcion']}:" />
						<h:inputTextarea id="descripcion"
							value="#{detalleParametroConfig.paramConfgDto.descripcion}"
							cols="800" rows="5" styleClass="long longPersona"
							disabled="#{detalleParametroConfig.estado == 'VER'}">
							<f:validateLength maximum="250" />
						</h:inputTextarea>
						<h:message for="descripcion" showSummary="true"
							showDetail="false" styleClass="validationErrorMessage" />
					</h:panelGrid>

					<h:panelGrid width="100%">
						<h:outputLabel
							value="#{msg['configuracion.parametrizacion.tipodato']}:" />
						<h:selectOneMenu id="tipodato"
							required="true"
							disabled="#{detalleParametroConfig.estado == 'VER'}"
							value="#{detalleParametroConfig.paramConfgDto.tipoDato}">
							<f:selectItem itemLabel="Seleccione ..." itemValue="#{null}" />
							<f:selectItems
								value="#{detalleParametroConfig.tipoDatoValues}" />
						</h:selectOneMenu>
						<h:message for="tipodato" showSummary="true"
							showDetail="false" styleClass="validationErrorMessage" />
					</h:panelGrid>

					<h:panelGrid width="100%">
						<h:panelGrid>
							<h:outputLabel
								value="#{msg['configuracion.parametrizacion.valor']}*:" />
							<h:inputText id="valor"
								value="#{detalleParametroConfig.paramConfgDto.valor}"
								required="true"
								disabled="#{detalleParametroConfig.estado == 'VER'}"
								requiredMessage="#{msgVal['constraint.not_null']}">
							</h:inputText>
							<h:message for="valor" showSummary="true"
								showDetail="false" styleClass="validationErrorMessage" />
						</h:panelGrid>
					</h:panelGrid>

					<br />
				</h:panelGroup>

				<h:panelGroup layout="block">
					<h:commandButton
						value="#{msg['configuracion.parametrizacion.guardar']}"
						action="#{detalleParametroConfig.guardarParametro}" 
						rendered="#{detalleParametroConfig.estado != 'VER'}">
					</h:commandButton>
					<h:commandButton value="#{msg['configuracion.parametrizacion.cancelar']}"
						action="#{detalleParametroConfig.cancelarEdit}" immediate="true">
					</h:commandButton>
				</h:panelGroup>
			</h:form>
		</rich:panel>
	</ui:define>
</ui:composition>